# Example plugin script
# needs to define init() ... otherwise it's dumped after load
irc = None

def init(bot):
    global irc
    bot.cmd.events['PRIVMSG'].subscribe(privmsg)
    bot.cmd.events['NOTICE'].subscribe(notice)
    bot.cmd.events['JOIN'].subscribe(join)
    irc = bot

def join(sender, args):
    global irc
    ops = ["kif.angrycoder.org", "c-76-25-4-66.hsd1.co.comcast.net"]
    if sender.host in ops:
        irc.mode(args[0], "+o", sender.nick)
    pass
    
def notice(sender, args):
    global irc
    if args[0] == "get lost":
        irc.quit("quit command recieved from %s" % sender.nick)
        pass
def privmsg(sender, args):
    global irc
    msg = args[0].split()

    if msg:
        if msg[0] == "!klstats":
            irc.kick(args[2], name, "Winner of the kick lotto.")
        
